package com.zhiqihang.ziqihangserverorders.controller;

import com.zhiqihang.api.OrderApi;
import com.zhiqihang.order.Orders;
import com.zhiqihang.result.JsonResult;
import com.zhiqihang.ziqihangserverorders.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName OrderController
 * @Description Violet
 * @Author 86183
 * @Date 2024/7/17 9:07
 * @Version 1.0
 */
@Slf4j
@RestController
@RequestMapping("v1/order/")
public class OrderController implements OrderApi {
    @Autowired
    private OrderService orderService;



    @GetMapping("findAll")
    public JsonResult findAll() {
        System.out.println("进入成功");
        return orderService.findAll();
    }

    @GetMapping("findById/{id}")
    public JsonResult findById(@PathVariable("id") Integer id){
        return null;
    }

    @PostMapping("add")
    public JsonResult add(Orders orders){
        return orderService.add(orders);
    }

}
